home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / FILE_SEA / README < prev   
Text File  |  1991-01-17  |  2KB  |  53 lines

  1. Essentialy these routines will help you search for a file, set the current dir,
  2. store the last known location in a resource, and get the path.
  3.  
  4. All the routines that you will call need to have a file record that we have
  5. defined passed to them.
  6.  
  7.                 typedef struct {
  8.                     char    fileName[32]; /* Pass a C String here*/
  9.                     short    ioVRefNum;
  10.                     long    ioDirID;
  11.                     } fileFindRec;
  12.  
  13. To find a file copy the file name into fileName. The ioVRefNum the ioDirID, fields 
  14. will be filled in by the searching routine. Next, decide the scope of your 
  15. search. By passing a combination of the constants below a file search can be 
  16. set to any desired scope.
  17.                 RESTRICT
  18.                 CURRENT
  19.                 BOOTDIR
  20.                 FOLDER
  21.                 PARENT
  22.                 WVOLUME
  23.                 ALLVOLUME
  24.                 
  25. strcpy (theRec.fileName,"The file I Want");
  26.                 
  27. doFileSearch (&theRec,RESTRICT | FOLDER);--limits to the current directory only
  28.                                          --folders within the current directory
  29.                                          --are NOT searched
  30. doFileSearch (&theRec,PARENT | FOLDER);--will search:
  31.                                              the parent
  32.                                              the current
  33.                                              any folders within the current
  34.                                              
  35. Once you have found your file before it can be accessed we need to set the default
  36. directory, use the routine, (fileSetDflt) passing in the appropiate file record.
  37. It will set and give you back the working directory ID.
  38.     
  39.                                              
  40. If you find the file you are looking for you might want to save it's last known
  41. location, there are two routines that can help you accomplish this:
  42.     fileSaveToRsrc 
  43.     fileGetFromRsrc
  44.     
  45.  
  46. These routines do not cover MFS, only the HFS file system.
  47. Must have at least 128K ROMS.
  48.  
  49. Thats it.. I hope this helps, Apple's documentation in this area is really hit
  50. and miss.
  51.  
  52.         --Wes Zuber, Clear View Systems--
  53.         --CIS 72607,3502               --